<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <!--如果是IE 就以标准渲染-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <!-- 视窗——————响应式布局 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />

    <!--当前页面的三要素-->
    <title>运维系统</title>
    <meta name="description" content="聚能优电" />
    <meta http-equiv="keywords" content="聚能优电" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <script type="text/javascript" src="./js/verify.js"></script>
    <!-- css -->
    <link rel="stylesheet" type="text/css" href="./css/common/common.css" />
    <link rel="stylesheet" type="text/css" href="./css/history.css" />
    <link rel="stylesheet" type="text/css" href="./font/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="css/mobiscroll.custom.min.css" />

</head>

<body>
    <div id="container" class="history">
        <div class="history_01">
            <!-- 主屏内容 -->
            <div class="history_screen">
                <div class="m_title">
                    <a href="JavaScript:history.go(-1);" class="back">
                        <img src="./images/back.svg" alt="">
                    </a>
                    <span class="tit">历史曲线</span>
                </div>

                <div class="m_con" id="project_con">
                    <!-- 参数名称 -->
                    <div class="cs_xmzs cs_common">
                        <div class="cs_tit">参数名称:</div>
                        <div class="cs_con">
                            <div class="tree"></div>
                            <!-- <button id="">获取选中数据</button> -->
                        </div>
                    </div>

                    <div class="cs_yixuan cs_common" id="chosed">
                        <div class="cs_tit">已选参数: <span style="font-size:0.24rem;color:red;">共计<span
                                    id="chosecount"></span>个</span> </div>
                        <div class="cs_con" id="chosed_con" style="color:#fff;">
                        </div>
                    </div>
                    <!-- 时间类型 -->
                    <div class="cs_sjstyle cs_common">
                        <span class="cs_tit">时间类型:</span>
                        <select id="select" value="">
                            <option value="-1">请选择时间类型</option>
                            <option value="2">日</option>
                            <option value="0">分</option>
                            <option value="1">时</option>
                            <option value="3">月</option>
                        </select>
                    </div>
                    <!-- 时间选择 -->
                    <div class="cs_sjchose cs_common" id="time_con">
                        <span class="cs_tit">时间选择:</span>
                        <div class="section" id="timechose">
                            <input type="text" id="demo_date1" placeholder="点击选择开始日期" /><input type="text"
                                id="demo_date2" placeholder="点击选择结束日期" />
                        </div>

                    </div>
                    <!-- 查询 -->
                    <button id="subdata" class="btnclass">
                        <!-- <button id="subdata" class="btnclass_dis"> -->
                        查 询
                    </button>
                </div>

                <div id="wraplsqx">
                    <div id="lsqx"></div>
                </div>
            </div>

        </div>
    </div>
    </div>


    <script>
        (function (win, doc) {
            var docEl = doc.documentElement || document.body; //获取HTML标签

            var container = doc.getElementById("container"); //container元素
            //判断是移动端设备还是PC,移动 就采用'orientationchange',横竖屏事件，PC端就采用onresize，窗口改变时间
            var resize =
                "onorientationchange" in win ? "orientationchange" : "resize";

            function rem() {
                docEl.style.fontSize = 100 * (container.clientWidth / 750) + "px";
            }

            //监听'DOMContent事件:DOM加载完成执行,如果DOMContent事件，那么执行rem函数
            doc.addEventListener("DOMContentLoaded", rem, false);

            //win下监听resize事件,如果resize事件，那么执行rem函数
            win.addEventListener(resize, rem, false);
        })(window, document);
    </script>
    <!-- js -->
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <script type="text/javascript" src="./js/leg-tree.js"></script>
    <script type="text/javascript" src="./js/mobiscroll.custom.min.js"></script>
    <script type="text/javascript" src="./js/echarts.js"></script>
    <script type="text/javascript" src="./js/jquery.table2excel.js"></script>
    <script type="text/javascript" src="./layer/layer.js"></script>
    <script>
        $(document).ready(function () {

            // 请求项目名称数据
            $.ajax({
                // type: "GET",
                // url: "http://112.74.169.99:21021/api/services/app/ProjectService/GetProjectInfosByUserid?userid="
                url: "http://112.74.169.99:21021/api/services/app/DeviceService/GetHistoryTreeModelsByUserID?userid=" +
                    userid,
                beforeSend: function (xhr) {
                    xhr.setRequestHeader("Accept",
                        "application/json, text/javascript, */*; q=0.01");
                    xhr.setRequestHeader("Authorization", accessToken);
                    xhr.setRequestHeader('.AspNetCore.Culture', 'zh-Hans');
                },
                success: function (res) {
                    var data = res.result;
                    var dataarr = [];
                    var dataobj = {};
                    dataobj.name = "全部项目";
                    dataobj.open = true;
                    dataobj.cascade = true;
                    dataobj.checked = false;
                    dataobj.id = '-1';
                    dataobj.level = '-1';
                    dataobj.columnName = '';
                    dataobj.children = [];
                    for (let i in data) {
                        var onerankdata = data[i];
                        var onerank = {};
                        onerank.name = onerankdata.title;
                        onerank.checked = false;
                        onerank.nocheck = false;
                        onerank.id = onerankdata.devid;
                        onerank.typeid = onerankdata.typeid;
                        onerank.key = onerankdata.key;
                        onerank.level = "0";
                        onerank.columnName = onerankdata.columnName;
                        onerank.children = [];
                        if (onerankdata.children.length > 0) {
                            onerank.open = false;
                            onerank.nocheck = false;
                            for (var j in onerankdata.children) {
                                var tworankdata = onerankdata.children[j];
                                var tworank = {};
                                tworank.name = tworankdata.title;
                                tworank.checked = false;
                                tworank.devid = tworankdata.devid;
                                tworank.typeid = tworankdata.typeid;
                                tworank.key = tworankdata.key;
                                tworank.columnName = tworankdata.columnName;
                                tworank.level = "1";
                                tworank.children = [];
                                if (tworankdata.children.length > 0) {
                                    tworank.open = false;
                                    tworank.nocheck = false;
                                    for (var k in tworankdata.children) {
                                        var threerankdata = tworankdata.children[k];
                                        var threerank = {};
                                        threerank.name = threerankdata.title;
                                        threerank.checked = false;
                                        threerank.devid = threerankdata.devid;
                                        threerank.typeid = threerankdata.typeid;
                                        threerank.key = threerankdata.key;
                                        threerank.columnName = threerankdata.columnName;
                                        threerank.level = "2";
                                        threerank.children = [];
                                        if (threerankdata.children.length > 0) {
                                            threerank.open = false;
                                            threerank.nocheck = false;
                                            for (var m in threerankdata.children) {
                                                var fourrankdata = threerankdata.children[m];
                                                var fourrank = {};
                                                fourrank.name = fourrankdata.title;
                                                fourrank.checked = false;
                                                fourrank.devid = fourrankdata.devid;
                                                fourrank.typeid = fourrankdata.typeid;
                                                fourrank.key = fourrankdata.key;
                                                fourrank.columnName = fourrankdata.columnName;
                                                fourrank.children = [];
                                                fourrank.level = "3";
                                                threerank.children.push(fourrank);
                                            }
                                        }
                                        tworank.children.push(threerank);
                                    }
                                }
                                onerank.children.push(tworank);
                            }
                        }
                        dataobj.children.push(onerank);
                    }
                    dataarr.push(dataobj);

                    var arrs = [];
                    $(".tree").tree(dataarr, arrs);

                },
                error: function (err) {
                    console.log(err);
                }
            });
            var chosestyle;
            // 时间类型切换
            $("#select").change(function () {

                chosestyle = $("#select option:selected").val();
                if (chosestyle != -1) {
                    $("#time_con").attr("style", 'display: block');
                    $("#subdata").attr("style", 'display: block');
                    if (chosestyle == 0) {
                        $("#timechose").html('');
                        $("#timechose").html(`
                    <input type="text" id="demo_datetime1" placeholder="点击选择开始时间" /><input type="text"
                        id="demo_datetime2" placeholder="点击选择结束时间" />`);
                    } else {
                        $("#timechose").html('');
                        $("#timechose").html(
                            `
                    <input type="text" id="demo_date1" placeholder="点击选择开始日期" /><input type="text" id="demo_date2" placeholder="点击选择结束日期" /> `
                        );
                    }
                } else if (chosestyle == -1) {
                    $("#time_con").attr("style", 'display: none');
                    $("#subdata").attr("style", 'display: none');

                }

                // 日期和时间控件
                var theme = "ios";
                var mode = "scroller";
                var display = "bottom";
                var lang = "zh";
                // 年月日选择1
                $('#demo_date1').mobiscroll().date({
                    theme: theme,
                    mode: mode,
                    display: display,
                    lang: lang
                });
                // 年月日选择2
                $('#demo_date2').mobiscroll().date({
                    theme: theme,
                    mode: mode,
                    display: display,
                    lang: lang
                });

                // 年月日时间选择1
                $('#demo_datetime1').mobiscroll().datetime({
                    theme: theme,
                    mode: mode,
                    display: display,
                    lang: lang,
                    dateFormat: "yyyy-mm-dd",
                    minDate: new Date(2000, 3, 10, 9, 22),
                    maxDate: new Date(2030, 7, 30, 15, 44),
                    stepMinute: 1
                });

                // 年月日时间选择2
                $('#demo_datetime2').mobiscroll().datetime({
                    theme: theme,
                    mode: mode,
                    display: display,
                    lang: lang,
                    dateFormat: "yyyy-mm-dd",
                    minDate: new Date(2000, 3, 10, 9, 22),
                    maxDate: new Date(2030, 7, 30, 15, 44),
                    stepMinute: 1
                });
            });


            var option;
            var legendarr;
            var seriesarr;
            var ec_lsqx;
            var wrap_lsqx;

            $("#subdata").on("click", () => {
                // 获取选取的参数数据
                var allsubdata = $.getCheckedNodes();
                var selectdata = [];
                if (allsubdata.length > 0) {
                    for (var i in allsubdata) {
                        if (allsubdata[i].level == 3) {
                            selectdata.push(allsubdata[i]);
                        }
                    }
                }
                // 验证选取的参数数据非空
                if (selectdata.length == 0) {
                    layer.msg('请选择参数', {
                        icon: 1,
                        time: 1000 //2秒关闭（如果不配置，默认是3秒）
                    });
                    return;
                }
                // 时间选择的非空验证
                chosestyle = $("#select option:selected").val();

                // 当选择时间时候获取当前的时间
                var nowtime = new Date();
                var nowMonth = nowtime.getMonth() + 1;
                var nowDate = nowtime.getDate() < 10 ? '0' + nowtime.getDate() : nowtime.getDate();
                var nowHours = nowtime.getHours() < 10 ? '0' + nowtime.getHours() : nowtime.getHours();
                var nowMinutes = nowtime.getMinutes() < 10 ? '0' + nowtime.getMinutes() : nowtime
                    .getMinutes();
                var nowSeconds = nowtime.getSeconds() < 10 ? '0' + nowtime.getSeconds() : nowtime
                    .getSeconds();

                var start_time;
                var end_time;
                var endMonth;
                var endDate;
                if (chosestyle == 0) { // 时间选择为分
                    start_time = new Date($("#demo_datetime1").val()).getTime();
                    end_time = new Date($("#demo_datetime2").val()).getTime();

                } else if (chosestyle == 1) { // 时间选择为时
                    start_time = new Date($("#demo_date1").val()).getTime();
                    end_time = $("#demo_date2").val();
                    var newdatest = new Date(start_time);
                    var newdateet = new Date(end_time);
                    endMonth = newdateet.getMonth() + 1;
                    endDate = newdateet.getDate() < 10 ? '0' + newdateet.getDate() : newdateet
                        .getDate();
                    if (newdatest.getTime() == newdateet.getTime()) {
                        if ((nowMonth == endMonth) && (nowDate == endDate)) {
                            // console.log('3月6号-3月6号');
                            end_time = nowtime.getTime();
                        } else {
                            // console.log('3月5号-3月5号');
                            endDate = Number(newdateet.getDate()) + 1;
                            endDate = endDate < 10 ? '0' + endDate : endDate;
                            end_time = new Date(end_time).getFullYear() + '/' + endMonth + '/' +
                                endDate + ' 00:00:00';
                            end_time = new Date(end_time).getTime();
                        }
                    } else {
                        if ((nowMonth == endMonth) && (nowDate == endDate)) {
                            // console.log('3月5号-3月6号');
                            end_time = nowtime.getTime();
                        } else {
                            end_time = new Date(end_time).getTime();
                        }
                    }
                } else if (chosestyle == 2) { // 时间选择为日
                    start_time = new Date($("#demo_date1").val()).getTime();
                    end_time = $("#demo_date2").val();
                    var newdateet = new Date(end_time);
                    endMonth = newdateet.getMonth() + 1;
                    endDate = newdateet.getDate() < 10 ? '0' + newdateet.getDate() : newdateet
                        .getDate();
                    endMonth = newdateet.getMonth() + 1;
                    if ((endMonth == nowMonth) && (nowDate == endDate)) {
                        end_time = nowtime.getTime();

                    } else {
                        endDate = Number(newdateet.getDate()) + 1;
                        endDate = endDate < 10 ? '0' + endDate : endDate;
                        end_time = new Date(end_time).getFullYear() + '/' + endMonth + '/' +
                            endDate + ' 00:00:00';
                        end_time = new Date(end_time).getTime();

                    }
                } else if (chosestyle == 3) { // 时间选择为月
                    start_time = new Date($("#demo_date1").val()).getTime();
                    end_time = new Date($("#demo_date2").val()).getTime();
                }
                if (!start_time || !end_time) {
                    layer.msg('请选择开始日期或者结束日期', {
                        icon: 1,
                        time: 1000
                    });
                    return;
                }
                var sjchatime = start_time - end_time;
                if (start_time && end_time && (sjchatime > 0)) {
                    layer.msg('开始日期小于或者等于结束日期', {
                        icon: 1,
                        time: 1000
                    });
                    return;
                }
                if (end_time > nowtime.getTime()) {
                    layer.msg('结束日期必须小于当前日期', {
                        icon: 1,
                        time: 1000
                    });
                    return;
                }
                $("#subdata").html('');
                $("#subdata").html('查询中...');
                $("#subdata").attr("disabled", true);
                $("#subdata").attr('class', 'btnclass_dis');


                wrap_lsqx = document.getElementById('wraplsqx');
                if (selectdata.length > 0) {
                    document.getElementById('lsqx').remove();
                    var add_lsqx = document.createElement('div');
                    add_lsqx.setAttribute('id', 'lsqx');
                    add_lsqx.style.height = '8rem';
                    add_lsqx.style.marginBottom = '0.5rem';
                    wrap_lsqx.appendChild(add_lsqx);
                    ec_lsqx = echarts.init(add_lsqx);
                }
                option = {};
                legendarr = [];
                seriesarr = [];

                var onoff = false;

                selectdata.forEach(element => {
                    var postdata = {
                        devid: element.devid,
                        typeid: element.typeid,
                        timetype: chosestyle,
                        columnName: element.columnname,
                        start: start_time, // 时间范围的开始时间
                        end: end_time, // 时间范围的结束时间
                    };
                    var ydataaa = [];
                    var xdatatimeaa = [];

                    $.ajax({
                        type: "GET",
                        url: "http://112.74.169.99:21021/api/services/app/ControlDataService/GetHistoryData?devid=" +
                            postdata.devid + "&typeid=" + postdata.typeid +
                            "&timetype=" + postdata.timetype + "&columnName=" + postdata
                            .columnName + "&start=" + postdata.start + "&end=" +
                            postdata.end,
                        beforeSend: function (xhr) {
                            xhr.setRequestHeader("Accept",
                                "application/json, text/javascript, */*; q=0.01"
                            );
                            xhr.setRequestHeader("Authorization", accessToken);
                            xhr.setRequestHeader('.AspNetCore.Culture',
                                'zh-Hans');
                        },
                        success: function (userdata) {
                            console.log("历史曲线  请求成功");
                            if (userdata.success) {
                                for (let i = 0; i < userdata.result.length; i++) {
                                    let datetime = new Date(userdata.result[i]
                                        .creationTime);
                                    let getFullYear = datetime.getFullYear();
                                    let theMonth = datetime.getMonth() + 1;
                                    let getMonth = theMonth < 10 ? '0' +
                                        theMonth : theMonth;
                                    let getDate = datetime.getDate() < 10 ? '0' +
                                        datetime.getDate() : datetime.getDate();
                                    let getHours = datetime.getHours() < 10 ? '0' +
                                        datetime.getHours() : datetime.getHours();
                                    let getMinutes = datetime.getMinutes() < 10 ?
                                        '0' + datetime.getMinutes() : datetime
                                        .getMinutes();
                                    let getSeconds = datetime.getSeconds() < 10 ?
                                        '0' + datetime.getSeconds() : datetime
                                        .getSeconds();
                                    let time;
                                    if (chosestyle == 0) { // 分
                                        time = getMonth + '-' + getDate + ' ' +
                                            getHours + ':' + getMinutes + ':' +
                                            getSeconds;
                                    } else if (chosestyle == 1) { // 时
                                        time = getMonth + '-' + getDate + ' ' +
                                            getHours + ':' + getMinutes;
                                    } else if (chosestyle == 2) { // 日
                                        time = getMonth + '-' + getDate;
                                    } else if (chosestyle == 3) { // 月
                                        time = getFullYear + '年' + getMonth + '月';
                                    }
                                    let userdatadata = userdata.result[i].data;
                                    
                                    let theydata = userdatadata; //保留小数点后两位
                                    ydataaa.push(theydata);
                                    xdatatimeaa.push(time);
                                }
                                let seriesdata = {};
                                seriesdata.name = element.parentname +
                                    element.name;
                                seriesdata.type = 'line';
                                
                                seriesdata.data = ydataaa;
                                seriesarr.push(seriesdata);
                                
                                legendarr.push(element.parentname + element.name);
                                let ll = legendarr;
                                if (legendarr.length === selectdata.length) {
                                    option = {
                                        title: {
                                            text: '历史曲线',
                                            textStyle: {
                                                color: '#fff',
                                                fontSize: '20',
                                                fontWeight: 'normal'
                                            },
                                        },
                                        tooltip: {
                                            trigger: 'axis',
                                            extraCssText:'width:auto;height:auto',
                                            position: function (point, params, dom, rect, size) {
                                                // 鼠标坐标和提示框位置的参考坐标系是：以外层div的左上角那一点为原点，x轴向右，y轴向下
                                                // 提示框位置
                                                var x = 0; // x坐标位置
                                                var y = 0; // y坐标位置
                                                
                                                // 当前鼠标位置
                                                var pointX = point[0];
                                                var pointY = point[1];
                                                
                                                // 外层div大小
                                                // var viewWidth = size.viewSize[0];
                                                // var viewHeight = size.viewSize[1];
                                                
                                                // 提示框大小
                                                var boxWidth = size.contentSize[0];
                                                var boxHeight = size.contentSize[1];
                                                
                                                // boxWidth > pointX 说明鼠标左边放不下提示框
                                                if (boxWidth > pointX) {
                                                    x = 5;
                                                } else { // 左边放的下
                                                    x = pointX - boxWidth;
                                                }
                                                
                                                // boxHeight > pointY 说明鼠标上边放不下提示框
                                                if (boxHeight > pointY) {
                                                    y = 5;
                                                } else { // 上边放得下
                                                    y = pointY - boxHeight;
                                                }
                                                
                                                return [x, y];
                                                }
                                        },
                                        legend: { //显示项目名称的图标
                                            type: 'scroll',
                                            icon: 'circle',
                                            itemGap: 13,
                                            data: legendarr,
                                            top: '15%',
                                            bottom: '20%',
                                            left: '10',
                                            width: '90%',
                                            height: '100',
                                            textStyle: {
                                                color: 'rgba(255,255,255,0.5)'
                                            }

                                        },
                                        grid: {
                                            left: '4%',
                                            right: '10%',
                                            bottom: '10%',
                                            top: '30%',
                                            containLabel: true,
                                        },
                                        dataZoom: { //底部拉缩条
                                            bottom: '5',
                                            height: '20',
                                            left: '40',
                                            right: '40',
                                            dataBackground: {
                                                lineStyle: {
                                                    color: '#39977D'
                                                },
                                                areaStyle: {
                                                    color: 'rgba(57,151,125,1)'
                                                },
                                            },
                                            borderColor: 'rgba(57,151,125,0.2)',
                                            textStyle: {
                                                color: '#39977D'
                                            },
                                            start: 0,
                                            end: 100,
                                            xAxisIndex: [0],
                                        },
                                        toolbox: { // 右上方的提示图标
                                            right: '20px',
                                            feature: {
                                                dataView: {
                                                    show: true,
                                                    title: 'EXCEL下载',
                                                    //readOnly: true, //设置只读，会隐藏刷新按钮。 
                                                    lang: ['EXCEL下载', '关闭',
                                                        '导出Excel'
                                                    ],
                                                    contentToOption: function (
                                                        opts) {
                                                        $('#tableExcel_Day')
                                                            .table2excel({
                                                                exclude: '.noExl',
                                                                //过滤位置的 css 类名 
                                                                filename: '历史曲线excel数据' +
                                                                    '.xls',
                                                                //文件名称 
                                                                name: 'Excel Document Name.xls',
                                                                exclude_img: true,
                                                                exclude_links: true,
                                                                exclude_inputs: true,
                                                            });
                                                    },
                                                    optionToContent: function (
                                                        opt) {
                                                        let axisData = opt
                                                            .xAxis[0]
                                                            .data;
                                                        //坐标数据 
                                                        let series = opt
                                                            .series;
                                                        //折线图数据 
                                                        let tdHeads =
                                                            '<td  style="padding: 0 10px">时间</td>';
                                                        //表头第一列 
                                                        let tdBodys =
                                                            ''; //表数据 
                                                        //组装表头 
                                                        let nameData = ll;
                                                        for (let i = 0; i <
                                                            nameData
                                                            .length; i++) {
                                                            tdHeads +=
                                                                '<td style="padding: 0 10px">' +
                                                                nameData[
                                                                    i] +
                                                                '</td>';
                                                        }
                                                        let table =
                                                            '<table id="tableExcel_Day" border="1" class="table-bordered table-striped" style="width:100%;text-align:center" ><tbody><tr>' +
                                                            tdHeads +
                                                            ' </tr>'; //组装表数据 
                                                        for (let i = 0, l =
                                                                axisData
                                                                .length; i <
                                                            l; i++) {
                                                            for (let j =
                                                                    0; j <
                                                                series
                                                                .length; j++
                                                            ) {
                                                                let temp =
                                                                    series[
                                                                        j]
                                                                    .data[
                                                                        i];
                                                                if (temp !==
                                                                    null &&
                                                                    temp !==
                                                                    undefined
                                                                ) {
                                                                    let
                                                                        thetemp =
                                                                        temp
                                                                        .substring(
                                                                            0,
                                                                            temp
                                                                            .indexOf(
                                                                                '.'
                                                                            ) +
                                                                            3
                                                                        );
                                                                    tdBodys
                                                                        +=
                                                                        '<td>' +
                                                                        thetemp +
                                                                        '</td>';
                                                                } else {
                                                                    tdBodys
                                                                        +=
                                                                        '<td></td>';
                                                                }
                                                            }
                                                            table +=
                                                                '<tr><td style="padding: 0 10px">' +
                                                                axisData[
                                                                    i] +
                                                                '</td>' +
                                                                tdBodys +
                                                                '</tr>';
                                                            tdBodys = '';
                                                        }
                                                        table +=
                                                            '</tbody></table>';
                                                        return table;
                                                    },
                                                },
                                                // saveAsImage: {
                                                //     show: true
                                                // },
                                            },
                                        },
                                        xAxis: [{
                                            type: 'category',
                                            data: xdatatimeaa,
                                            boundaryGap: false,
                                            axisLine: {
                                                //坐标轴轴线相关设置
                                                lineStyle: {
                                                    // color: "#162B48",
                                                    color: "rgba(255,255,255,0.5)",
                                                    width: "1"
                                                }
                                            },
                                            axisLabel: {
                                                //坐标轴刻度标签的相关设置
                                                show: true,
                                                // interval:1,
                                                textStyle: {
                                                    // color: "#526073",
                                                    color: "rgba(255,255,255,0.5)",
                                                    fontSize: 10
                                                },
                                                rotate: 30
                                            }

                                        }, ],
                                        yAxis: [{
                                            type: 'value',
                                            axisTick: {
                                                show: false,
                                            },
                                            splitLine: {
                                                show: false
                                            },
                                            axisLine: {
                                                //坐标轴轴线相关设置
                                                lineStyle: {
                                                    // color: "#162B48",
                                                    color: "rgba(255,255,255,0.5)",
                                                    width: "1"
                                                }
                                            },
                                            axisLabel: {
                                                //坐标轴刻度标签的相关设置
                                                show: true,
                                                // color: "#526073",
                                                color: "rgba(255,255,255,0.5)",
                                                fontSize: 10
                                            },
                                            scale: true,
                                        }, ],
                                        series: seriesarr,
                                    };
                                    ec_lsqx.setOption(option);
                                    $("#subdata").html('');
                                    $("#subdata").html('查 询');
                                    $("#subdata").attr("disabled", false);
                                    $("#subdata").attr('class', 'btnclass');
                                }
                            }
                        },
                        error: function (err) {
                            console.log("历史曲线 请求失败");
                        }
                    });
                });

            })





        });
    </script>

</body>

</html>